<!-- 数字地图-基本资料-教学楼定位 -->
<template>
  <div class="JNPF-common-layout">
    <div class="JNPF-common-layout-center">
      <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>

          <el-col :span="6">
            <el-form-item label="所属区域">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="教学楼名称">
              <el-input v-model="listQuery.fcatname" placeholder="请输入编号或名称" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="">
              <el-button type="primary" icon="el-icon-search" @click="getlist">查询</el-button>
              <el-button type="warning" icon="el-icon-upload2">导入</el-button>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <div class="JNPF-common-layout-main JNPF-flex-main">
        <JNPF-table :data="list" border v-loading="loading">
          <el-table-column prop="FPARENTNO" label="所属区域" ></el-table-column>
          <el-table-column prop="FCATNO" label="教学楼编号" ></el-table-column>
          <el-table-column prop="FCATNAME" label="教学楼名称"></el-table-column>
          <el-table-column prop="FCATTYPE" label="教学楼类型"></el-table-column>
          <el-table-column prop="FADDRESS" label="定位器编号"></el-table-column>
          
          <el-table-column fixed="left" label="操作" width="150">
            <template slot-scope="scope">
              <el-button @click.native.prevent="insert(scope.row.FCATNO)" icon="el-icon-edit" type="text" size="small">
                编辑
              </el-button>
              <el-popconfirm title="确定清空定位器信息吗？" @confirm="Catdelete(scope.row.FCATNO)">
                <el-button slot="reference" icon="el-icon-delete" style="color: red;margin-left: 10px;"
                  type="text">清空</el-button>
              </el-popconfirm>
            </template>
          </el-table-column>
        </JNPF-table>
        <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" />
        <Form ref="Form" :parelist="list" />
      </div>
    </div>
  </div>
</template>

<script>
  import Form from "./Form.vue"
  export default {
    name: 'shop',
    components: { Form },
    data() {
      return {
        fvisiblelist: [
          { id: "1", fullName: "是" },
          { id: "2", fullName: "否" },
        ],
        total: 0,
        list: [
        {
          "FPARENTNO": "东区",
          "FCATNO": "20E01",
          "FCATNAME": "第一教学楼",
          "FADDRESS": "E1-01",
          "FSEQNO": 28,
          "FVISIBLE": 1,
          "FCATTYPE": "教学楼",
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FPARENTNO": "东区",
          "FCATNO": "20E02",
          "FCATNAME": "第二教学楼",
          "FADDRESS": "E1-02",
          "FSEQNO": 28,
          "FVISIBLE": 1,
          "FCATTYPE": "教学楼",
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FPARENTNO": "南区",
          "FCATNO": "20N01",
          "FCATNAME": "第一实验楼",
          "FADDRESS": "S1-01",
          "FSEQNO": 28,
          "FVISIBLE": 1,
          "FCATTYPE": "实验楼",
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FPARENTNO": "南区",
          "FCATNO": "20N02",
          "FCATNAME": "第二实验楼",
          "FADDRESS": "S1-02",
          "FSEQNO": 28,
          "FVISIBLE": 1,
          "FCATTYPE": "实验楼",
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        }
        ],

        //所属区域选择数据
        options1: [{
          value: '2001',
          label: '东区'
        }, {
          value: '2002',
          label: '南区'
        }],

        loading: false,
        listQuery: {
          page: 1,
          limit: 20,
          sort: "desc",
          sidx: "",
          fcatno: "",
          fcatname: ""
        },
      };
    },
    computed: {},
    created() {
    },
    methods: {
      insert(row) {
        this.$refs.Form.init(row);
      },
    },
  };
</script>